using Microsoft.AspNetCore.Mvc;
namespace BookShareWebApp
{

    public class UploadinfoController : Controller
    {

        private readonly BookContext _bookcontext;
        public UploadinfoController(BookContext bookcontext)
        {
            _bookcontext = bookcontext;
            
        }

        [HttpPost("/api/uploadbookinfo")]
        public JsonResult uploadinfo([FromBody]Book book){
            
            _bookcontext.Book.Add(book);
            _bookcontext.SaveChanges();

            return Json("Ok");
        }

    }
}